<script type='text/javascript' src="<?php echo $this->basePath('public/css/dbblack/js/artdialog/artDialog.js?skin=simple'); ?>"></script>
<script type='text/javascript' src="<?php echo $this->basePath('public/css/dbblack/js/artdialog/plugins/iframeTools.js'); ?>"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $this->basePath('public/css/dbblack/js/form/style.css'); ?>"/>
<script type='text/javascript' src="<?php echo $this->basePath('public/css/dbblack/js/form/form.js'); ?>"></script>
<div class="simple-box " style="width:600px;margin:40px auto;" >
    <?php
    if (isset($this->message) and $this->message != '') {
        echo '<br><h4>' . $this->message . '</h4>';
    } else {
        ?>
        <form action="" method="post">
            <input type="hidden" name="other_logion_type" value="register">
            <ul class="form">
                <li><span class="perfix fa">&#xf007;</span><input name="user_name" id="user_name" value="<?php echo $this->other_user_info['nickname']; ?>" class="input" pattern="required" placeholder="<?php echo $this->translate('输入会员名称'); ?>" alt="<?php echo $this->translate('请输入会员登录名称！'); ?>"><label></label></li>
                <?php if($this->other_login_email_state == 'true') { ?>
                    <li><span class="perfix fa">&#xf003;</span><input class="input"  name="user_email" id="user_email"  pattern="required" placeholder="<?php echo $this->translate('输入会员邮箱'); ?>"></li>
                <?php } ?>
                <li><input type="submit" class="btn btn-main" value="<?php echo $this->translate('提交补充信息(建立新账户)'); ?>"></li>
            </ul>
        </form>
        <hr>
        <form action="" method="post">
            <input type="hidden" name="other_logion_type" value="login">
            <ul class="form">
                <li><span class="perfix fa">&#xf007;</span><input name="login_user_name" id="login_user_name"  class="input" pattern="required" placeholder="<?php echo $this->translate('输入会员名称'); ?>" alt="<?php echo $this->translate('请输入会员登录名称！'); ?>"><label></label></li>
                <li><span class="perfix fa">&#xf084;</span><input class="input"  name="login_user_passwd" id="login_user_passwd"  pattern="required" placeholder="<?php echo $this->translate('输入会员密码'); ?>" alt="<?php echo $this->translate('请输入会员密码！'); ?>"></li>
                <li><input type="submit" class="btn btn-main" value="<?php echo $this->translate('提交绑定现有账户'); ?>"></li>
            </ul>
        </form>
    <?php } ?>

</div>
<script type="text/javascript">
    $("input[name='user_name']").on("change",function(event){
        if(autoValidate.validate(event)){
            $.post("<?php echo $this->url('frontuser/default/user_id',array('action'=>'check','controller'=>'user','check_type'=>'user_name','user_id'=>($this->user_info ? $this->user_info->user_id : '0'))); ?>",{user_name:$(this).val()},function(data){
                if(data == 'false') {
                    autoValidate.showMsg({id:document.getElementById('user_name'),error:true,msg:'<?php echo $this->translate('该会员名已经存在！'); ?>'});
                }
            });
        }
    });
    <?php if($this->other_login_email_state == 'true') { ?>
    $("input[name='user_email']").on("change",function(event){
        if(autoValidate.validate(event)){
            $.post("<?php echo $this->url('frontuser/default/user_id',array('action'=>'check','controller'=>'user','module'=>'user','check_type'=>'user_email','user_id'=>($this->user_info ? $this->user_info->user_id : '0'))); ?>",{user_email:$(this).val()},function(data){
                if(data == 'false') {
                    autoValidate.showMsg({id:document.getElementById('user_email'),error:true,msg:'<?php echo $this->translate('该邮箱已经存在'); ?>'});
                }
            });
        }
    });
    <?php } ?>

</script>
